A Methodology for Writing Class Contracts
نویسندگان
چکیده
One of the principles of Design by Contract is that contracts for software components must be written in a declarative way, using a formal, mathematically founded notation. When we apply the Design by Contract methodology in a naive and straightforward way, we risk ending up with unwanted duplication. In this paper, we describe a methodology for writing class contracts that avoids specification duplication and that gives rise to uniform class specifications with a clear and fixed structure. A Methodology for Writing Class Contracts Nele Smeets*, Eric Steegmans Katholieke Universiteit Leuven, Department of Computer Science, Celestijnenlaan 200A, 3001 Leuven, Belgium {Nele.Smeets, Eric.Steegmans}@cs.kuleuven.ac.be *Research Assistant of the Fund for Scientific Research Flanders (Belgium) Abstract. One of the principles of Design by Contract is that contracts for software components must be written in a declarative way, using a formal, mathematically founded notation. When we apply the Design by Contract methodology in a naive and straightforward way, we risk ending up with unwanted duplication. In this paper, we describe a methodology for writing class contracts that avoids specification duplication and that gives rise to uniform class specifications with a clear and fixed structure. One of the principles of Design by Contract is that contracts for software components must be written in a declarative way, using a formal, mathematically founded notation. When we apply the Design by Contract methodology in a naive and straightforward way, we risk ending up with unwanted duplication. In this paper, we describe a methodology for writing class contracts that avoids specification duplication and that gives rise to uniform class specifications with a clear and fixed structure.
منابع مشابه
Social Media Writing and Social Class: A Correlational Analysis of Adolescent CMC and Social Background
In a large social media corpus (2.9 million tokens), we analyze Flemish adolescents’ non-standard writing practices and look for correlations with the teenagers’ social class. Three different aspects of adolescents’ social background are included: educational track, parental profession, and home language. Since the data reveal that these parameters are highly correlated, we combine them into on...
متن کاملA Probe into Adaptive Transfer across Writing Contexts: A Case of an EGAP Class
In an effort to expand the disciplinary discussions on transfer in L2 writing and because most studies have focused on transfer as reuse and not as an adequate adaptation of writing knowledge in new contexts, the present study as the first of its kind aimed to explore the issue of adaptive transfer in an English for General Academic Purposes (EGAP) writing course. The study thus focused on type...
متن کاملExtending a Method of Devising Software Contracts
Classes in object-oriented programs can be specified using assertions, specifically, preconditions and postconditions on individual methods and invariants on whole classes. Such assertions can be seen as forming a contract between a class and its client classes and, by extension, between the developers of a class and the developers of client classes. In some programming environments, the contra...
متن کاملEffects of Receiving Corrective Feedback through Online Chats and Class Discussions on Iranian EFL Learners' Writing Quality
Giving corrective feedback (CF) is an essential part of the teaching and learning process, and the way it should beneficially be done has been the focus of attention for numerous researchers especially when traditional ways of CF provision are not possible, particularly in rare situations such as outbreaks of diseases. This study investigated how different ways of giving feedback; namely, throu...
متن کاملDesign by Contract Using Meta-Assertions
The important role that class contracts Ð pre and post-conditions of methods, and invariants Ð play in the specification, monitoring and reuse of classes is becoming increasingly accepted by the OO community. The several languages of assertions and monitoring code generation tools that exist allow the specification and, eventually, the runtime checking of very powerful and elegant contracts. Th...
متن کامل